const $http = require('../../../utils/http')
Page({

   
    data: {
        qw_img : [] ,
        dish_data :[] 
    },
    
    searchData(e) { 
        console.log(e.detail.value);
        let in_value = e.detail.value
        return Promise.allSettled([
            $http({
                url: `http://101.43.139.233:8080/dish/select/1/10/` + in_value,
            }),
        ]).then((res)=>{ 
            wx.hideLoading();
            let  dish_data = res[0].value.data.data.records ; 
            console.log(dish_data);
            this.setData({
                dish_data : dish_data 
            })
            // console.log("this.data-----" + JSON.stringify(this.data.dish_data));
        })
    },
    // 搜索
    search_input() { 
        let dish_dataJSON = JSON.stringify(this.data.dish_data);
        console.log(dish_dataJSON);
        wx.navigateTo({
          url: '../../selected_reault/selected_reault?id=' + dish_dataJSON,
        })
        
        // console.log(e);
    },
    onLoad(options) {
        this.searchData()
    },

   
})